import Mock from 'mockjs'

// 测试用
Mock.mock('/test', 'get', {
  status: 0,
  data: {
    id: 12,
    username: 'admin',
    email: 'admin@51purse.com',
    phone: null,
    role: 0,
    createTime: 1479048325000,
    updateTime: 1479048325000
  }
})

// 用户列表
Mock.mock('/userlist', 'get', {
  status: 0,
  data: {
    total: 2,
    userList: [
      {
        id: '01',
        username: 'admin',
        password: 'admin',
        email: 'admin@happymmall.com',
        phone: '15011111111',
        question: '啊哈哈',
        answer: '服不服',
        role: 0,
        createTime: 1489719093000,
        updateTime: 1513682138000
      },
      {
        id: '02',
        username: 'sa',
        password: 'sa',
        email: 'sa@happymmall.com',
        phone: '15011111111',
        question: '啊哈哈',
        answer: '服不服',
        role: 0,
        createTime: 1489719093000,
        updateTime: 1513682138000
      }
    ]
  }
})

// 获取购物车商品数量
Mock.mock('/carts/products/sum', 'get', {
  status: 0,
  data: 8
})
